package com.lzp.config;

import com.lzp.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 关闭订单任务
 *
 * @author dtyy
 * @date 2020/10/1
 */
@Component
public class CloseOrderJob {

    @Autowired
    private OrderService orderService;

    /**
     * 每小时执行一次
     */
    @Scheduled(cron = "0 0 0/1 * * ? ")
    public void closeOrderJob() {
        orderService.closeOrder();
    }
}
